package com.example.usercode.service.controller;

import com.example.usercode.service.bean.R;
import com.example.usercode.service.service.IUserCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/11/4 17:50
 * FileName: UserCodeController
 * Description:
 */

@RestController
public class UserCodeController {

    @Autowired
    IUserCodeService userCodeService;

    @GetMapping("code")
    public R getCode(String userName){
        return R.ok().data(userCodeService.getCode(userName));
    }


    @GetMapping("token")
    public R getToken(String userName){
        return R.ok().data(userCodeService.getToken(userName));
    }
}
